/**
 * Copyright (C) 2018-2020
 * All rights reserved, Designed By www.yixiang.co
 * 注意：
 * 本软件为www.yixiang.co开发研制
 */
package co.yixiang.modules.shop.service;

import co.yixiang.common.service.BaseService;
import co.yixiang.modules.shop.domain.YxUserAddress;
import co.yixiang.modules.shop.service.dto.YxUserAddressDto;
import co.yixiang.modules.shop.service.dto.YxUserAddressQueryCriteria;
import org.springframework.data.domain.Pageable;

import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
 * @author chajiu
 * @date 2021-04-22
 */
public interface YxUserAddressService extends BaseService<YxUserAddress> {

    /**
     * 获取某人默认地址
     * @param uid
     * @return
     */
    YxUserAddress getDefaultAddress(Long uid);


    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map
    <String,Object>
     */
    Map
            <String, Object> queryAll(YxUserAddressQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List
    <YxUserAddressDto>
     */
    List<YxUserAddress> queryAll(YxUserAddressQueryCriteria criteria);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List
                          <YxUserAddressDto> all, HttpServletResponse response) throws IOException;
}
